<div class="tabs-container">
    <ul class="nav nav-tabs">
        <li class="{{ Active::query('sold_out','ACTIVITY') }}"><a
                    href="{{route('admin.shop.goods.index',['shop_id' => request('shop_id'), 'sold_out'=>'ACTIVITY'])}}">上架</a>
        </li>
        <li class="{{ Active::query('sold_out','UNACTIVITY') }}"><a
                    href="{{route('admin.shop.goods.index',['shop_id' => request('shop_id'), 'sold_out'=>'UNACTIVITY'])}}">下架</a>
        </li>
    </ul>
    <div class="tab-content">
        <div id="tab-1" class="tab-pane active">
            <div class="panel-body">
                <div>
                    <div class="col-md-2">
                        {{--<input type="checkbox" class="check-full"> 全选 &nbsp;&nbsp;&nbsp;&nbsp;--}}
                        <a class="btn btn-primary" data-toggle="modal-filter" data-target="#modal"
                           data-backdrop="static" data-keyboard="false"
                           data-url="{{route('admin.shop.goods.editBatchGoods',['value'=>request('value'),  'sold_out'=>request('sold_out')])}}"
                           href="javascript:;">
                            批量修改
                        </a>
                    </div>
                    <div class="col-md-10">
                        <form action="" method="get" class="form-horizontal">
                            <div class="col-md-4">
                                <label class="col-sm-4 control-label">年份：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" name="year">
                                        <option value="">请选择</option>
                                        @foreach($years as $year)
                                            <option value="{{$year['name']}}">{{$year['name']}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <label class="col-sm-4 control-label">季节：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" name="season_id">
                                        <option value="">请选择</option>
                                        @foreach($seasons as $season)
                                            <option value="{{$season->id}}">{{$season->name}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <input type="hidden" name="sold_out"
                                       value="{{request('sold_out') ? request('sold_out') : ''}}">
                                <input type="hidden" name="shop_id"
                                       value="{{request('shop_id') ? request('shop_id') : ''}}">
                                <div class="form-group">
                                    <div class="input-group">
                                        <input type="text" name="value" placeholder="商品编码"
                                               value="{{!empty(request('value'))?request('value'):''}}"
                                               class=" form-control"> <span class="input-group-btn"><button
                                                    type="submit" class="btn btn-primary">查找
                                            </button></span>
                                    </div>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
                <table class="table table-hover table-striped table-bordered" id="goods-table">
                    <thead>
                    <tr>
                        <th><input type="checkbox" class="check-all"></th>
                        <th>商品名称</th>
                        <th>商品编码</th>
                        <th>进货价(元)</th>
                        <th>吊牌价(元)</th>
                        <th>库存数量</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($goods as $value)
                        @if($good=$value->goods)
                            <tr class="goods{{$value->id}}" data-id="{{$value->id}}">
                                <td><input class="checkbox" type="checkbox" value="{{$value->id}}" name="ids[]">
                                </td>
                                <td>{{$good->name}}</td>
                                <td>{{$good->goods_no}}</td>
                                <td>{{$good->factory_price}}</td>
                                <td>{{$good->market_price}}</td>
                                <td>
                                    {{$value->store_nums ? $value->store_nums : 0}}
                                </td>
                                <td>
                                    <a class="btn btn-xs btn-primary"
                                       href="{{route('admin.shop.goods.editGoods',['id'=>$value->id, 'shop_id'=>request('shop_id')])}}">
                                        <i data-toggle="tooltip" data-placement="top" class="fa fa-pencil-square-o"
                                           title="编辑"></i>
                                    </a>
                                </td>
                            </tr>
                        @endif
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
        <div class="pull-left">
            {!! $goods->total() !!} 件商品
        </div>

        <div class="pull-right">
            {!! $goods->appends(['value'=>request('value')])->render() !!}
        </div>
        <div class="box-footer clearfix">
        </div>
    </div>
</div>
<div id="modal" class="modal inmodal fade" data-keyboard=false data-backdrop="static"></div>


{!! Html::script(env("APP_URL").'/assets/backend/libs/sortable/Sortable.min.js') !!}
@include('shop-backend::goods.includes.script')